def setup(settings, app, request_class):
    """Setup is perfomred early and for certain before first request is
    handled.
    """

    @app.before_first_request
    def before_first_request():
        pass

    @app.before_request
    def example_preprocessor():
        pass

    @app.after_request
    def after_request(resp):
        """If there is anything that api should do before ending request, add
        it in here for example you might have transactional backend that
        require commit or rollback at the end of each request.

        NOTE: if unhandled exception happens, this function is not going to be
        executed.
        """
        return resp
    app.debug = settings.DEBUG
    app.request_class = request_class
