rest_client instead of Curb, refactoring