public async Task<IHttpActionResult> PutBlocks(int id, Blocks blocks)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

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

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

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BlocksExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
        public async Task<IHttpActionResult> PostBlocks(Blocks blocks)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Blocks.Add(blocks);
            await db.SaveChangesAsync();

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