public IHttpActionResult PutBranchNode(int id, BranchNode branchNode)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != branchNode.GuardId)
            {
                return BadRequest();
            }

            db.Entry(branchNode).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BranchNodeExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
        public IHttpActionResult PostBranchNode(BranchNode branchNode)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.BranchNodes.Add(branchNode);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = branchNode.GuardId }, branchNode);
        }