Added sorting into search service in restful api

see #307