Routers and APIViews (general or others) are two different ways to create API endpoints. Routers only work with views.
In your code, you are trying to create a view for a router in which your code extends the APIView class.
Your problem will take care of what @linovia has proposed in its Anyer. I would suggest that it would be nice to understand the difference between the two.
GenericViewSet inherits from GenericAPIView, but does not provide any implementation of the main actions. Only get_object, get_queryset.
ModelViewSet inherits from GenericAPIView and includes implementations for various actions. In other words, you do not need to implement basic actions in the form of a list, retrieval, creation, update or destruction. Of course, you can override them and implement your own list or your own creation methods.
More about viewsets and a universal class based on APIViews :
source share