Started refactoring API.