Changed things to work the flask way