more api, plus tests, and things