Bug fixing: api.ok failed for centroids and batch centroids