add api and test