API updates and refactoring