Move query route in app.py