public IHttpActionResult PutPlanItemInTrip([FromODataUri] string key, [FromODataUri] int tripId, [FromODataUri] int planItemId, PlanItem planItem)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (planItemId != planItem.PlanItemId)
            {
                return BadRequest("The PlanItem Id of PlanItem does not match the planItemId parameter.");
            }

            var person = TripPinSvcDataSource.Instance.People.SingleOrDefault(item => item.UserName == key);
            if (person == null)
            {
                return NotFound();
            }

            var trip = person.Trips.SingleOrDefault(item => item.TripId == tripId);
            if (trip == null)
            {
                return NotFound();
            }

            var oldPlanItem = trip.PlanItems.SingleOrDefault(item => item.PlanItemId == planItemId);
            if (oldPlanItem == null)
            {
                return NotFound();
            }

            trip.PlanItems.Remove(oldPlanItem);
            trip.PlanItems.Add(planItem);
            return Updated(planItem);
        }
        public IHttpActionResult PostNewPlanItemInTrip([FromODataUri] string key, [FromODataUri] int tripId, PlanItem planItem)
        {
            var person = TripPinSvcDataSource.Instance.People.SingleOrDefault(item => item.UserName == key);
            if (person == null)
            {
                return NotFound();
            }

            var trip = person.Trips.SingleOrDefault(item => item.TripId == tripId);
            if (trip == null)
            {
                return NotFound();
            }

            planItem.PlanItemId = trip.PlanItems.Max(item => item.PlanItemId) + 1;
            trip.PlanItems.Add(planItem);
            return Created(planItem);
        }