async def get_task_or_404(task_key: str, database=Depends(get_database)) -> Task:
    try:
        return (await database.get(task_key))
    except DataLayerException:
        raise HTTPException(status_code=404, detail=f'Task {task_key} not found')
async def get_task_or_404(task_key: str, database=Depends(get_database)) -> Task:
    try:
        return (await database.get(task_key))
    except DataLayerException:
        raise HTTPException(status_code=404, detail=f'Task {task_key} not found')