Models+api

totally not ready, but almost there.