following the flask tutorial http://flask.pocoo.org/docs/tutorial/