Add unit tests for public API

At least one unit test for each method that belongs to the public API.