Fix setting hooks in ApiQueryTest

Also fix the comment

Change-Id: I4245a5f515980c743965996aecc67b42b616b50c
Merge "Fix setting hooks in ApiQueryTest"