Updated for parts of the new api.

Still not done. Looking into generation tools.