Add: function into models and fix some errors with url resolvers.