I don’t understand it either, why the js api is served by php to the client. It should be a real file, or at least it should implement browser caching.
The ever serving of the js and another seemingly non-dynamic content overwhemls the servers cpu wise. I have opcache enabled and still.