Added some add and edit functionality and extra validation