public async Task<ActionResult> Save(BooksEditViewModel viewModel)
        {
            var jObject = viewModel.ToJObject();

            var saveResult = await this.apiClient.SaveBook(jObject, this.Token);
            if (saveResult.ResultCode == Enums.ResultCode.Ok)
            {
                return RedirectToAction("Edit", new { id = saveResult.Data.ObjectId, message = "Save Successful" });
            }
            else
            {
                return View("Edit", viewModel);
            }

        }
 public async Task<ActionResult> Edit(int? id = null, string message = null)
 {
     if (id.HasValue)
     {
         var bookData = await this.apiClient.GetBook(id.Value);
         if (bookData.ResultCode == Enums.ResultCode.Ok)
         {
             var viewModel = new BooksEditViewModel(bookData.Data);
             return View(viewModel);
         }
         else
         {
             return RedirectToAction("Error", "Home");
         }
     }
     else
     {
         return View(new BooksEditViewModel());
     }            
 }
        public ActionResult AddSection(BooksEditViewModel viewModel)
        {
            if (viewModel != null)
            {
                int maxDisplayOrder;
                if (viewModel.Sections == null || viewModel.Sections.Count <= 0)
                {
                    viewModel.Sections = new List<BookEditSectionViewModel>();
                    maxDisplayOrder = 0;
                }
                else
                {
                    maxDisplayOrder = viewModel.Sections.Max(s => s.DisplayOrder);
                }

                viewModel.Sections.ForEach(s => s.Content = HttpUtility.HtmlDecode(s.Content));
                viewModel.Sections.Add(new BookEditSectionViewModel() { DisplayOrder = maxDisplayOrder + 1 });
                return PartialView ("EditorTemplates/BookSectionEditor", viewModel);
            }
            return this.HttpNotFound();
        }