AQ: Implemented UI and API changes to download query definition in JSON format