Moved category validator over to validator.js`
Removed extraneous code and transferred further validation code to validator.js