improvements to the way API and model to work to allow for inheritance
various fixes