Improved rest client