added validations and db constraints to task and user model