Query translation, execution and result handling