use segmentation api instead