added validation
added authentication
added comments