add segments api