Refactor ApiHelper to correct deserialization