add unit tests
update unit tests to use new API