more API call refactoring