api: set the Accept header

This allows us to more flexibly change what the API does by switching on
the Accept header in the future.