All API Stuff moved to one class, some code refactoring