api defined and working for saving/retrieving grouped queries