Add segment API