began work on the REST API and related controller functions for segments.