Fix rest client bug