Refactor API call into API object, and stub all the other methods