Ruote name depends on the http server and yii configuration (enabling rewrite rules and enablimg pretty urls) and on controller and action name case .
From your stackoverflow post it seem you are working with URL rewrite and pretty URL.
If pretty URL is properly configured thinks like:
-localhost/myproject/admin/index.php?r=api/totalviews
Do not work.
The first part of the route depends on your http configuration.
Yii advanced template has 3 application already configured: backend, frontend, console
Console is for the command line, the other 2 are for web.
The web application have same dir structure and http webroot should point to web directory
So something like
/var/www/myproject/backend
Where myproject is yii installation and backend is the web application, the webroot is
/var/www/myproject/backend/web
And in the browser is
Http://localhost/
For basic application template, where there is only the web application, the webserver configuration should point to web directory as well.
So assuming that your configurations (both http server and pretty urls) are correct, your controller name is ApiController and your action name is actionTotalviews, the URl is http://localhost/api/totalviews.
Yii manage 404 errors internally and the message looks different from webserver one, if the message you get is from webserver your webserver configuration is wrong.