added some api and tests