public DataResponse GetCoins() { ValuesService valuesService = new ValuesService(); List <Coin> CoinInfo = new List <Coin>(); var response = valuesService.GetCoins(); if (response.IsSuccessStatusCode) { var CoinResponse = response.Content.ReadAsStringAsync().Result; CoinInfo = response.Content.ReadAsAsync <List <Coin> >().Result; } DataResponse output = new DataResponse { recordsTotal = CoinInfo.Count(), data = CoinInfo.ToArray() }; return(output); }