moved api to diff repo, more refactoring