Finished the segment handlers POST function