refactored code, use httpbin as dummy resource.