More tests and work on the API.