New API version. Full refactoring.