single line as_media_type(options).to_json should suffice