Corrects url_for js routing in flask.