more tests, API cleanup