Add analytics support for /api routes.