Add sort and search to backend