parsing json object from request body in put and post handlers