sorted results
refactor rest client