changed restclient logic