clean up API and add unit tests/README