documents controller accepts sort order as a param and sorts in the specified direction