'A view that returns a serialized list of all resources registers
to the ``Api``. Useful for discovery.'

def top_level(self, request, api_name=None):

    fullschema = request.GET.get(u'fullschema', False)
    fullschema = string_to_python(fullschema)
    available_resources = {}
    if (api_name is None):
        api_name = self.api_name
    for (name, resource) in self._registry.items():
        if (not fullschema):
            schema = self._build_reverse_url(u'api_get_schema', kwargs={u'api_name': api_name, u'resource_name': name})
        else:
            schema = resource.build_schema()
        available_resources[name] = {u'list_endpoint': self._build_reverse_url(u'api_dispatch_list', kwargs={u'api_name': api_name, u'resource_name': name}), u'schema': schema}
    desired_format = determine_format(request, self.serializer)
    options = {}
    if (u'text/javascript' in desired_format):
        callback = request.GET.get(u'callback', u'callback')
        if (not is_valid_jsonp_callback_value(callback)):
            raise BadRequest(u'JSONP    callback    name    is    invalid.')
        options[u'callback'] = callback
    serialized = self.serializer.serialize(available_resources, desired_format, options)
    return HttpResponse(content=serialized, content_type=build_content_type(desired_format))
