API refactor, adding new types, clean up