Move api interface into its own file.