rewrite data model to use new api
validate: better error messages