public async Task <HttpResponseMessage> PostPopularWonders(int take, [FromBody] WonderModel model)
        {
            try
            {
                var results = await PostWonders(model, api : String.Format("wonder/popular/{0}", take));

                return(Request.CreateResponse(HttpStatusCode.Created, results));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
            }
        }
        public async Task <HttpResponseMessage> PostWonders([FromBody] WonderModel model)
        {
            try
            {
                var results = await PostWonders(model, api : "wonder");

                return(Request.CreateResponse(HttpStatusCode.Created, results));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
            }
        }
        public async Task <HttpResponseMessage> PostPriorityWonders([FromBody] WonderModel model)
        {
            try
            {
                //var results = await PostWonders(model, api: @"wonder/priority");
                var results = await Task.Run(() => GetFor <DealModel>(String.Format("wonder/all/{0}/{1}/{2}", model.UserId, model.CityId, true)));

                return(Request.CreateResponse(HttpStatusCode.Created, results));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
            }
        }
        static async private Task <List <DealModel> > PostWonders(WonderModel model, string api)
        {
            var httpClient = new HttpClient();
            var payload    = JsonConvert.SerializeObject(model);
            var response   = await Task.Run(() => httpClient.PostAsync(baseUrl + api, new StringContent(payload, Encoding.UTF8, "application/json")));

            if (response.IsSuccessStatusCode)
            {
                List <DealModel> results;
                using (HttpContent content = response.Content)
                {
                    var stringResult = await content.ReadAsStringAsync();

                    results = JsonConvert.DeserializeObject <List <DealModel> >(stringResult);
                }

                return(results);
            }
            else
            {
                throw new Exception(response.ReasonPhrase);
            }
        }
        public async Task <HttpResponseMessage> PostNearestWonders(int radiusFrom, int radiusTo, [FromBody] WonderModel model)
        {
            try
            {
                var results = await PostWonders(model, api : @"wonder/nearest/" + radiusFrom + "/" + radiusTo);

                return(Request.CreateResponse(HttpStatusCode.Created, results));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
            }
        }