The assumption you made in your question is actually revealing.
What if the it were a 3rd party API?
What if the API is Google Maps?
Should the frontend have to route a request to Google Maps through a certain "context API"?
If so, why?
Greg's answer is sound. It depends on where you want to do the composition.
If *the* API is meant for 3rd party consumption, I'd do it on the server.
Otherwise, I could go either way depending on "factors". *
* Scratching around for a twist on "it depends". ;-]