strutured orm-type model layer from angularjs