Total API refactoring