parsing query to determine hook, added validation