Callback API for verifying the number of queries produced by given block of code