factored out the request format handling for all HTTP verbs in base_controller