// DELETE: api/Users/5
        public UserRespose Delete([FromBody]UserRequest request)
        {
            var checkResult = _RunAllChecks(request.Token, request);
            if (checkResult != null)
            {
                return checkResult;
            }

            using (DatabaseModel model = new DatabaseModel())
            {
                Expression<Func<User, bool>> predicate = x => x.UserId == request.User.UserId;

                if (model.Users.Any(predicate) == false)
                {
                    return _Package("UserId was not found", null);
                }

                if (model.Journeys.Any(x => x.UserId == request.User.UserId))
                {
                    return _Package("A journey is currently attatched this user. You cannot delete a user with existing journeys", null);
                }

                model.Users.Remove(model.Users.SingleOrDefault(predicate));
                model.SaveChanges();

                return _Package(null, null);
            }
        }
        public JourneyRespose Get([FromUri] string token, [FromUri] int id)
        {
            if (Utils.CheckToken(token))
            {
                return _TokenFailed();
            }

            using (DatabaseModel model = new DatabaseModel())
            {
                return _Package(null, model.Journeys.SingleOrDefault(x => x.JourneyId == id));
            }
        }
        // DELETE: api/Journeys/5
        public JourneyRespose Delete([FromBody]JourneyRequest request)
        {
            if (Utils.CheckToken(request.Token))
            {
                return _TokenFailed();
            }

            using (DatabaseModel model = new DatabaseModel())
            {
                Expression<Func<Journey, bool>> predicate = x => x.JourneyId == request.Journey.JourneyId;

                if (model.Journeys.Any(predicate) == false)
                {
                    return _Package("JourneyId was not found", null);
                }

                model.Journeys.Remove(model.Journeys.Single(predicate));
                model.SaveChanges();

                return _Package(null, null);
            }
        }
        // POST: api/Journeys
        public JourneyRespose Post([FromBody]JourneyRequest request)
        {
            var errorCheck = _RunAllChecks(request.Token, request);
            if (errorCheck != null)
            {
                return errorCheck;
            }

            using (DatabaseModel model = new DatabaseModel())
            {
                if (model.Users.Any(x => x.UserId == request.Journey.UserId) == false)
                {
                    return _Package("A journey must be assigned to a user", null);
                }

                model.Journeys.Add(request.Journey);
                model.SaveChanges();

                return _Package(null, request.Journey);
            }
        }
        // PUT: api/Journeys/5
        public JourneyRespose Put([FromBody]JourneyRequest request)
        {
            if (Utils.CheckToken(request.Token))
            {
                return _TokenFailed();
            }

            using (DatabaseModel model = new DatabaseModel())
            {
                var modelToUpdate = model.Journeys.SingleOrDefault(x => x.JourneyId == request.Journey.JourneyId);
                modelToUpdate.Name = request.Journey.Name;
                model.SaveChanges();

                return _Package(null, modelToUpdate);
            }
        }
        // POST: api/Users
        public UserRespose Post([FromBody]UserRequest request)
        {
            var checkResult = _RunAllChecks(request.Token, request);
            if (checkResult != null)
            {
                return checkResult;
            }

            using (DatabaseModel model = new DatabaseModel())
            {
                model.Users.Add(request.User);
                model.SaveChanges();

                return  _Package(null, request.User);
            }
        }
        // PUT: api/Users/5
        public UserRespose Put([FromBody]UserRequest request)
        {
            var checkResult = _RunAllChecks(request.Token, request);
            if (checkResult != null)
            {
                return checkResult;
            }

            using (DatabaseModel model = new DatabaseModel())
            {
                var modelToUpdate = model.Users.SingleOrDefault(x => x.UserId == request.User.UserId);

                modelToUpdate.Name = request.User.Name;
                modelToUpdate.Username = request.User.Username;

                model.SaveChanges();

                return _Package(null, request.User);
            }
        }