add custom segment handling to jsapi model