Flaskified the whole thing