add models, extetions; refactor errors