public async Task <ActionResult <Weather> > Get(string city) { string apiKey = config.GetSection("ApiKey").Value; Weather result; try { OpenWeather openWeather = new OpenWeather(apiKey); result = await openWeather.City(city); } catch (HttpRequestException httpRequestException) { return(BadRequest(httpRequestException.Message)); } return(result); }