add before_request, after_request, errorhandler