Query Function Fastapi Templates