Convert to flask app