Api refactoring [ PSR-2 + fix documentation + errors ]