Change API to pass back the sort_by as a string value instead of boolean, and change client template to use it