API Refactoring and Bugfixing