Return JSON responses with correct mimetype.