api: fix getLabels never returning existing checked labels correctly