How to build a Flask application around an already existing database