change api interface. add test code.