Added functions for getting query details.