def create_api_routing(config, api):
    """
    Central method to create the routing per api. This way a independent routing is created which takes even
    the route prefix into account.

    Args:
        config (pyramid.config.Configurator): The pyramid apps config object
        api (pyramid_georest.lib.rest.Api): The Api which the routing is bound to.
    """
    config.add_route('{api_name}/read'.format(api_name=api.name), '/' + api
        .pure_name + '/{schema_name}/{table_name}/read/{format}')
    config.add_view(api, route_name='{api_name}/read'.format(api_name=api.
        name), attr='read', request_method=(api.read_method, api.
        read_filter_method))
    config.add_route('{api_name}/count'.format(api_name=api.name), '/' +
        api.pure_name + '/{schema_name}/{table_name}/count')
    config.add_view(api, route_name='{api_name}/count'.format(api_name=api.
        name), attr='count', request_method=(api.read_method, api.
        read_filter_method), renderer='string')
    config.add_route('{api_name}/show'.format(api_name=api.name), '/' + api
        .pure_name + '/{schema_name}/{table_name}/read/{format}/*primary_keys')
    config.add_view(api, route_name='{api_name}/show'.format(api_name=api.
        name), attr='show', request_method=api.read_method)
    config.add_route('{api_name}/create'.format(api_name=api.name), '/' +
        api.pure_name + '/{schema_name}/{table_name}/create/{format}')
    config.add_view(api, route_name='{api_name}/create'.format(api_name=api
        .name), attr='create', request_method=api.create_method)
    config.add_route('{api_name}/update'.format(api_name=api.name), '/' +
        api.pure_name +
        '/{schema_name}/{table_name}/update/{format}/*primary_keys')
    config.add_view(api, route_name='{api_name}/update'.format(api_name=api
        .name), attr='update', request_method=api.update_method)
    config.add_route('{api_name}/delete'.format(api_name=api.name), '/' +
        api.pure_name +
        '/{schema_name}/{table_name}/delete/{format}/*primary_keys')
    config.add_view(api, route_name='{api_name}/delete'.format(api_name=api
        .name), attr='delete', request_method=api.delete_method)
    config.add_route('{api_name}/model'.format(api_name=api.name), '/' +
        api.pure_name + '/{schema_name}/{table_name}/model/{format}')
    config.add_view(api, route_name='{api_name}/model'.format(api_name=api.
        name), attr='model', request_method=api.read_method)
    config.add_route('{api_name}/adapter'.format(api_name=api.name), '/' +
        api.pure_name + '/{schema_name}/{table_name}/adapter/{format}')
    config.add_view(api, route_name='{api_name}/adapter'.format(api_name=
        api.name), attr='adapter', request_method=api.read_method)
    config.commit()
