retrieve data from db in app.py call