added validator.js and have done the validation half