added simple api and test cases