rewrote the api interface