Pholey rewrite

I've learned that we need to use werkzeug more. http://werkzeug.pocoo.org/docs/utils/#werkzeug.utils.redirect