Workaround for the fact that the core webservices.rest module doesn't nicely convert Maps, so we need to manually handle cohorts