added sort on API call

need to test