Abstracted the HTTP client code to an adapter trait