another big refactor. decided to generate the API instead so it could be modified.  more like a scaffold now.