added data sorter to process function in API