Have upload() return a JSON object upon success