More robust rest client

accepts 2xx response codes as ok