Fixes #9.

Added basic unit tests for the API.