added some simple server-side validation

Added some server side validations.