fix the api
change test cases to mocha