// POST api/Expenses
        public HttpResponseMessage PostExpenseRecord(ExpenseRecord expenserecord)
        {
            if (ModelState.IsValid)
            {
                //expenserecord.Date = DateTime.UtcNow;
                expenserecord.User = db.UserProfiles.Single(p => p.UserName == User.Identity.Name);

                db.ExpenseRecords.Add(expenserecord);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, expenserecord);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = expenserecord.ExpenseRecordId }));
                return response;
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
        // PUT api/Expenses/5
        public HttpResponseMessage PutExpenseRecord(int id, ExpenseRecord expenserecord)
        {
            if (ModelState.IsValid && id == expenserecord.ExpenseRecordId)
            {
                db.Entry(expenserecord).State = EntityState.Modified;

                try
                {
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return Request.CreateResponse(HttpStatusCode.NotFound);
                }

                return Request.CreateResponse(HttpStatusCode.OK);
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }