Fixing TypeError, because r.json is not a function call but already a json object