sort api search results by date