Update API to match spec

* rename types
* add missing types
* generate errors when accessing internal constructors