major API refactoring