Moved app.py and changed the way that querying was done