rough validator.js structure implemented