output proper json with mime type