added validations and database migrations