from rest_framework.decorators import api_view, permission_classes
from rest_framework.response import Response
from rest_framework.reverse import reverse

@api_view(['GET'])
@permission_classes([])
def api_root(request, format=None):
    return Response({
        'tracks': reverse('api-tracks', request=request, format=format),
        'artists': reverse('api-artists', request=request, format=format),
        'users': reverse('api-users', request=request, format=format),
        'albums': reverse('api-albums', request=request, format=format),
        'votes': reverse('api-votes', request=request, format=format),
    })
