Refactor RestfulServerV2 code out into APIRequest