update controller

validate data before insert or update
show error or success message