def METHOD_NAME(flask_app=api_classes.App, flask_api=api_classes.AiidaApi, **kwargs):
    """
    Takes a flask.Flask instance and runs it.
    :param flask_app: Class inheriting from flask app class
    :type flask_app: :py:class:`flask.Flask`
    :param flask_api: flask_restful API class to be used to wrap the app
    :type flask_api: :py:class:`flask_restful.Api`
    :param hostname: hostname to run app on (only when using built-in server)
    :param port: port to run app on (only when using built-in server)
    :param config: directory containing the config.py file used to configure the RESTapi
    :param catch_internal_server:  If true, catch and print all inter server errors
    :param debug: enable debugging
    :param wsgi_profile: use WSGI profiler middleware for finding bottlenecks in web application
    :param posting: Whether or not to include POST-enabled endpoints (currently only `/querybuilder`).
    :returns: tuple (app, api) if hookup==False or runs app if hookup==True
    """
    hostname = kwargs.pop('hostname', CLI_DEFAULTS['HOST_NAME'])
    port = kwargs.pop('port', CLI_DEFAULTS['PORT'])
    debug = kwargs.pop('debug', APP_CONFIG['DEBUG'])
    api = configure_api(flask_app, flask_api, **kwargs)
    # Run app through built-in werkzeug server
    print(f" * REST API running on http://{hostname}:{port}{API_CONFIG['PREFIX']}")
    api.app.run(debug=debug, host=hostname, port=int(port), threaded=True)