/// <summary>
        /// Puts a single transaction
        /// </summary>
        /// <param name="id"></param>
        /// <param name="transaction"></param>
        public IHttpActionResult PutTransaction(long id, Transaction transaction)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            transaction.TransactionId = id;
            if (transaction == null)
            {
                return(BadRequest("Transaction not found"));
            }

            try
            {
                //db.Entry(transaction).State = EntityState.Modified;
                db.MarkAsModified(transaction);
                db.SaveChanges();
            }
            catch
            {
                return(BadRequest(ModelState));
            }

            return(Ok());
        }