How to Count in REST API in v4?

Hello there. I have followed your code. However, there is only one single count route. I want all the default routes and the count route. How should I modify the code?