Output correct content-type with API responses.

Fixes #281