// DELETE: api/subcategories/5
        public async Task <HttpResponseMessage> Delete(string id)
        {
            if (!string.IsNullOrWhiteSpace(id))
            {
                bool hasChildren = await _subcategoryobj.ContainsProducts(id);

                if (!hasChildren)
                {
                    try
                    {
                        var deletedsubcategory = await _subcategoryobj.DeleteItemAsync(id);

                        return(Request.CreateResponse(HttpStatusCode.NoContent));
                    }
                    catch (Microsoft.Azure.Documents.DocumentClientException e)
                    {
                        string message = "Sub-Category to be deleted doesn't exist or was not found ";
                        return(Request.CreateErrorResponse(HttpStatusCode.NotFound, message));
                    }
                }
                else
                {
                    string message = "Sub-Category to be deleted has one or many subcategories , hence cannot be deleted ";
                    return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, message));
                }
            }
            else
            {
                string message = "Enter valid SubCategoryId to be deleted ";
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, message));
            }
        }