Query Function Fastapi Templateswise