HTTP API needs to respond with correct Content-Type in all cases

Apparently there are still places where it uses `text/html` instead of `application/json`.