major refactoring, api scheleton standing up.