global refactoring for models
improvements for models module
refactoring for API + new api methods (for tickets and todos)