save method converted to JSONObject