flatten qids array as expected by frontend