add validation to group model and add unit tests