Added the UI and the implementations of QueryManager