Using new Model api. Added methods to User dataclass for login validation.