public async Task<ForecastCapability[]> GetCapabilities()
        {
            string result = null;

            try
            {
                Debug.WriteLine("Getting capabilities from DataPoint Service...");
                result = await Task.Factory.StartNew<string>(()
                    => "{\"MountainForecastList\":{\"MountainForecast\":[{\"DataDate\":\"2014-12-07T18:29:10Z\",\"ValidFrom\":\"2014-12-07T18:00:00Z\",\"ValidTo\":\"2014-12-11T18:00:00Z\",\"CreatedDate\":\"2014-12-07T18:30:25Z\",\"URI\":\"http:\\/\\/datapoint.metoffice.gov.uk\\/public\\/data\\/txt\\/wxfcs\\/mountainarea\\/{format}\\/100?key={key}\",\"Area\":\"Brecon Beacons\",\"Risk\":\"High\"},{\"DataDate\":\"2014-12-07T17:36:25Z\",\"ValidFrom\":\"2014-12-07T17:00:00Z\",\"ValidTo\":\"2014-12-11T17:00:00Z\",\"CreatedDate\":\"2014-12-07T17:46:17Z\",\"URI\":\"http:\\/\\/datapoint.metoffice.gov.uk\\/public\\/data\\/txt\\/wxfcs\\/mountainarea\\/{format}\\/101?key={key}\",\"Area\":\"East Highland\",\"Risk\":\"High\"},{\"DataDate\":\"2014-12-07T16:25:08Z\",\"ValidFrom\":\"2014-12-07T16:00:00Z\",\"ValidTo\":\"2014-12-11T16:00:00Z\",\"CreatedDate\":\"2014-12-07T17:46:25Z\",\"URI\":\"http:\\/\\/datapoint.metoffice.gov.uk\\/public\\/data\\/txt\\/wxfcs\\/mountainarea\\/{format}\\/102?key={key}\",\"Area\":\"Lake District\",\"Risk\":\"High\"},{\"DataDate\":\"2014-12-07T17:01:32Z\",\"ValidFrom\":\"2014-12-07T17:00:00Z\",\"ValidTo\":\"2014-12-11T17:00:00Z\",\"CreatedDate\":\"2014-12-07T17:46:16Z\",\"URI\":\"http:\\/\\/datapoint.metoffice.gov.uk\\/public\\/data\\/txt\\/wxfcs\\/mountainarea\\/{format}\\/103?key={key}\",\"Area\":\"Peak District\",\"Risk\":\"Medium\"},{\"DataDate\":\"2014-12-07T18:38:24Z\",\"ValidFrom\":\"2014-12-07T18:00:00Z\",\"ValidTo\":\"2014-12-11T18:00:00Z\",\"CreatedDate\":\"2014-12-07T18:39:45Z\",\"URI\":\"http:\\/\\/datapoint.metoffice.gov.uk\\/public\\/data\\/txt\\/wxfcs\\/mountainarea\\/{format}\\/104?key={key}\",\"Area\":\"Snowdonia\",\"Risk\":\"High\"},{\"DataDate\":\"2014-12-07T17:49:15Z\",\"ValidFrom\":\"2014-12-07T17:00:00Z\",\"ValidTo\":\"2014-12-11T17:00:00Z\",\"CreatedDate\":\"2014-12-07T17:52:59Z\",\"URI\":\"http:\\/\\/datapoint.metoffice.gov.uk\\/public\\/data\\/txt\\/wxfcs\\/mountainarea\\/{format}\\/105?key={key}\",\"Area\":\"West Highland\",\"Risk\":\"High\"},{\"DataDate\":\"2014-12-07T17:00:31Z\",\"ValidFrom\":\"2014-12-07T17:00:00Z\",\"ValidTo\":\"2014-12-11T17:00:00Z\",\"CreatedDate\":\"2014-12-07T17:46:15Z\",\"URI\":\"http:\\/\\/datapoint.metoffice.gov.uk\\/public\\/data\\/txt\\/wxfcs\\/mountainarea\\/{format}\\/106?key={key}\",\"Area\":\"Yorkshire Dales\",\"Risk\":\"Medium\"}]}}");
            }
            catch (Exception ex)
            {
                throw new Exception("Failed to get capabilities from service provider. The service maybe down. Retry or try again later.", ex);
            }

            ForecastCapability[] forecastCapability;

            try
            {
                var forecastsToken = JObject.Parse(result)["MountainForecastList"]["MountainForecast"];

                forecastCapability = forecastsToken.Select(forecast => {

                    var capability = new ForecastCapability
                    {
                        IssuedDate = DateTime.Parse((string)forecast["DataDate"]),
                        ValidFrom = DateTime.Parse((string)forecast["ValidFrom"]),
                        ValidTo = DateTime.Parse((string)forecast["ValidTo"]),
                        CreatedDate = DateTime.Parse((string)forecast["CreatedDate"]),
                        Uri = new Uri((string)forecast["URI"]),
                        Area = (string)forecast["Area"]
                    };

                    Risk risk;
                    Enum.TryParse<Risk>((string)forecast["Risk"], out risk);
                    capability.Risk = risk;
                    return capability;

                }).ToArray();
            }
            catch (Exception ex)
            {
                throw new FormatException("Failed to format forecast capabilities.", ex);
            }

            return forecastCapability;
        }
        public async Task<ForecastCapability[]> GetCapabilities()
        {
            string result = null;

            try
            {
                Debug.WriteLine("Getting capabilities from DataPoint Service...");
                result = await Get("txt/wxfcs/mountainarea/json/capabilities");   
            }
            catch (Exception ex)
            {
                throw new Exception("Failed to get capabilities from service provider. The service maybe down. Retry or try again later.", ex);
            }

            ForecastCapability[] forecastCapability;

            try
            {
                var forecastsToken = JObject.Parse(result)["MountainForecastList"]["MountainForecast"];

                forecastCapability = forecastsToken.Select(forecast => {

                    var capability = new ForecastCapability
                    {
                        IssuedDate = DateTime.Parse((string)forecast["DataDate"], CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
                        ValidFrom = DateTime.Parse((string)forecast["ValidFrom"], CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
                        ValidTo = DateTime.Parse((string)forecast["ValidTo"], CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
                        CreatedDate = DateTime.Parse((string)forecast["CreatedDate"], CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
                        Uri = new Uri((string)forecast["URI"]),
                        Area = (string)forecast["Area"]
                    };

                    Risk risk;
                    Enum.TryParse<Risk>((string)forecast["Risk"], out risk);
                    capability.Risk = risk;
                    return capability;

                }).ToArray();
            }
            catch (Exception ex)
            {
                throw new FormatException("Failed to format forecast capabilities.", ex);
            }

            return forecastCapability;
        }