def api_server(api_services, **kwargs):
<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>from . import _logger as endpoints_logger<EOL>from . import __version__ as endpoints_version<EOL>endpoints_logger.info('<STR_LIT>', endpoints_version)<EOL>apis_app = _ApiServer(api_services, **kwargs)<EOL>dispatcher = endpoints_dispatcher.EndpointsDispatcherMiddleware(apis_app)<EOL>service_name = os.environ.get('<STR_LIT>')<EOL>if not service_name:<EOL><INDENT>_logger.warn('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>return dispatcher<EOL><DEDENT>if control_wsgi.running_on_devserver():<EOL><INDENT>_logger.warn('<STR_LIT>')<EOL>return dispatcher<EOL><DEDENT>from endpoints_management import _logger as management_logger<EOL>from endpoints_management import __version__ as management_version<EOL>management_logger.info('<STR_LIT>', management_version)<EOL>controller = control_client.Loaders.DEFAULT.load(service_name)<EOL>control_client.use_gae_thread()<EOL>controller.start()<EOL>return control_wsgi.add_all(<EOL>dispatcher,<EOL>app_identity.get_application_id(),<EOL>controller)<EOL>
Create an api_server.

    The primary function of this method is to set up the WSGIApplication
    instance for the service handlers described by the services passed in.
    Additionally, it registers each API in ApiConfigRegistry for later use
    in the BackendService.getApiConfigs() (API config enumeration service).
    It also configures service control.

    Args:
      api_services: List of protorpc.remote.Service classes implementing the API
        or a list of _ApiDecorator instances that decorate the service classes
        for an API.
      **kwargs: Passed through to protorpc.wsgi.service.service_handlers except:
        protocols - ProtoRPC protocols are not supported, and are disallowed.

    Returns:
      A new WSGIApplication that serves the API backend and config registry.

    Raises:
      TypeError: if protocols are configured (this feature is not supported).