Implemented simple QueryValidator

added QueryParser test case too.