add tests; expand API coverage