Moved api interface to model.