/// TODO: further testing requried on this method.  Not always excepting question object in request body.
        /// <summary>
        ///  Method should post an entire brand new question to the database.  Including adding in the subquestions and answers.
        /// </summary>
        /// <param name="question">ExamQuestion Object in Request Body</param>
        /// <endpoint>[HttpPost]: api/ExamQuestion</endpoint>
        /// <returns>HTTP Response on success or failure of the method</returns>
        public HttpResponseMessage Post([FromBody] WCF.ExamQuestion question)
        {
            try
            {
                if (question.ExamQuestionID == null || question.ExamQuestionName == null || question.QuestionType == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "Invalid Exam Question"));
                }

                client.AddExamQuestion(question);

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }
        public HttpResponseMessage GetSpecificExamQuestion(string questionID)
        {
            try
            {
                WCF.ExamQuestion examQuestion = GetSpecificExQuest(questionID);

                if (examQuestion == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "Exam question does not exist"));
                }

                return(Request.CreateResponse(HttpStatusCode.OK, examQuestion));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }
        //returns a specific exam question, private method used inside public method
        private WCF.ExamQuestion GetSpecificExQuest(string questionID)
        {
            try
            {
                List <WCF.ExamQuestion> examQuestions = client.GetAllExamQuestion().ToList();

                if (examQuestions == null || examQuestions.Count <= 0)
                {
                    return(null);
                }

                WCF.ExamQuestion examQuestion = examQuestions.FirstOrDefault(exQ => exQ.ExamQuestionID == questionID);

                return(examQuestion);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public HttpResponseMessage GetSpecificQuestionSubjects([FromUri] string questionID)
        {
            try
            {
                WCF.ExamQuestion   examQuestion             = GetSpecificExQuest(questionID);
                List <WCF.Subject> subjects                 = client.GetAllSubject().ToList();
                List <WCF.Subject> specificQuestionSubjects = null;

                if (examQuestion == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "Not able to retrieve exam question"));
                }

                if (subjects == null || subjects.Count <= 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "Not able to retrieve Subjects"));
                }


                foreach (WCF.Subject subject in subjects)
                {
                    foreach (WCF.Category cat in subject.listCat)
                    {
                        foreach (WCF.Category category in examQuestion.ExamQuestion_Categories)
                        {
                            if (cat.Categories_ID == category.Categories_ID)
                            {
                                specificQuestionSubjects.Add(subject);
                            }
                        }
                    }
                }

                return(Request.CreateResponse(HttpStatusCode.OK, specificQuestionSubjects));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }