public override HttpResponseMessage GetResponse()
        {
            var requestedEntry = JSONObject.Parse <StoreEntry>(Request.Content.GetString());

            ServerDataModel.AddStoreEntry(requestedEntry);
            var response = new HttpResponseMessage(HttpStatusCode.OK)
            {
                ContentType = ApplicationJsonContent
            };

            response.Content.SetString(ServerDataModel.GetSerializedStoreEntry(requestedEntry.key));
            return(response);
        }
        public HttpResponseMessage GetSuccessResponse()
        {
            var response = new HttpResponseMessage(200)
            {
                ContentType = ApplicationJsonContent
            };

            // if the absolute path ENDs with store url, it means to get all the store entries
            if (Regex.IsMatch(Request.RequestUri.AbsolutePath, Constraints.StoreUrl + "$", RegexOptions.IgnoreCase))
            {
                response.Content.SetString(ServerDataModel.GetSerializedStoreEntry());
            }
            else
            {
                // otherwise, get a specific entry
                var entryKey = Request.RequestUri.AbsolutePath.Substring(
                    Request.RequestUri.AbsolutePath.IndexOf(Constraints.StoreUrl, 0,
                                                            StringComparison.InvariantCultureIgnoreCase) +
                    Constraints.StoreUrl.Length + 1);
                response.Content.SetString(ServerDataModel.GetSerializedStoreEntry(entryKey));
            }
            return(response);
        }