add model validation and implements delete