if status == 'new':
        tasks = tasks.filter_by(status=DistributedQueryTask.NEW)
    elif status == 'pending':
        tasks = tasks.filter_by(status=DistributedQueryTask.PENDING)
    elif status == 'complete':