Refactoring APICalls