// These methods could be exported into a common API object and this API class inheriting it private async Task <T> SendAsync <T>(IApiRequest request) where T : class { var url = $"{Settings.Url}/{request.GetUrl()}?code={Settings.ApiKey}"; var message = new HttpRequestMessage { Method = request.GetMethod(), RequestUri = new Uri(url) }; var response = await Client.Value.SendAsync(message); var responseContent = await response.Content.ReadAsStringAsync(); if (!response.IsSuccessStatusCode) { throw new ApplicationException($"{response.StatusCode} - {responseContent}"); } return(responseContent.Deserialize <T>()); }