more api refactoring