public IHttpActionResult Postkpi(kpi kpi)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.kpis.Add(kpi);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (kpiExists(kpi.id_kpi))
                {
                    return Conflict();
                }
                else
                {
                    throw;
                }
            }

            return CreatedAtRoute("DefaultApi", new { id = kpi.id_kpi }, kpi);
        }
        public IHttpActionResult Putkpi(int id, kpi kpi)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != kpi.id_kpi)
            {
                return BadRequest();
            }

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

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

            return StatusCode(HttpStatusCode.NoContent);
        }