def register_model_with_api(
        self, module, model_class, router, route_prefix, serializer_class=None, viewset_mixin=None, register_admin=False
    ):
        if serializer_class is None:
            serializer_class = generate_model_serializer(module, model_class)

        if viewset_mixin is None:
            viewset_class = generate_model_viewset(module, model_class, serializer_class)
        else:
            viewset_class = generate_model_viewset(module, model_class, serializer_class, mixin_class=viewset_mixin)

        router.register(route_prefix, viewset_class)

        self.register(model_class, serializer_class)

        if register_admin:
            admin.site.register(model_class)