Add X-Analytics header for API requests too
Add a hook handler for APIAfterExecute, which runs after an API request.
"*fm" API formats use OutputPage, so they were already calling the
BeforePageDisplay hook. To avoid duplicating information,
XAnalytics::generateHeader() can only be called once per request.