changed the way upload_media.json returned errors