Added API!
Refactoring everything