server side validations for #52
refactor for server validations