beginning of refactoring api calls into factories