Majour refactoring in API