Wrapper that handles http requests