public async Task <JsonResult> apiDelete(long id)
        {
            int      userid = GetUserId().Value;
            Bookmark bmark  = _context.Bookmark.Where(bm => (bm.Id.Equals(id) && bm.UserId == userid)).First();

            _context.Bookmark.Remove(bmark);
            await _context.SaveChangesAsync();

            // now check if deleted document still have bookmarks
            Document doc = _context.Document.Find(bmark.DocumentId);

            if (doc.DocStatus == Document.DocStatusEnum.Deleted)
            {
                DocumentsController dc = new DocumentsController(_context, _smngr, null, null, null, null)
                {
                    ControllerContext = ControllerContext,
                    //  User = User
                };
                await dc.TryDeletePermanent(doc);
            }
            return(Json(new { status = "Ok" }));
        }