Add first version of API.
Add test coverage.