v4: Return mimetype='application/json' where appropriate

fixes #3653