changed valueForKey to use json.Marshal