public IHttpActionResult GetSTSByStudent(string studentUsername)
        {
            try
            {
                Student student = studentService.GetStudentByUserName(studentUsername);

                string userId = ((ClaimsPrincipal)RequestContext.Principal).FindFirst(x => x.Type == "UserId").Value;

                if (User.IsInRole("parents"))
                {
                    if (userId == student.Parent.Id)
                    {
                        return(Ok(studentService.GetNameAndGrades(studentUsername)));
                    }
                    else
                    {
                        return(Ok(stsService.GetStudentInfo(studentUsername)));
                    }
                }

                if (User.IsInRole("students"))
                {
                    if (userId == student.Id)
                    {
                        return(Ok(studentService.GetNameAndGrades(studentUsername)));
                    }
                    else
                    {
                        return(Ok(stsService.GetStudentInfo(studentUsername)));
                    }
                }

                return(Ok(studentService.GetNameAndGrades(studentUsername)));
            }
            catch (NullReferenceException)
            {
                logger.Warn("Student with this username does not exist");
                return(NotFound());
            }
            catch (Exception e)
            {
                logger.Error(e, "Exception thrown");
                return(BadRequest(e.Message));
            }
        }
        public IHttpActionResult GetStudent(string id)
        {
            Student student         = studentService.GetStudentById(id);
            string  userId          = ((ClaimsPrincipal)RequestContext.Principal).FindFirst(x => x.Type == "UserId").Value;
            string  studentUsername = student.UserName;

            if (student == null)
            {
                logger.Warn("Search does not exist");
                return(NotFound());
            }


            if (User.IsInRole("parents"))
            {
                if (userId == student.Parent.Id)
                {
                    return(Ok(studentService.GetStudentById(id)));
                }
                else
                {
                    return(Ok(stsService.GetStudentInfo(studentUsername)));
                }
            }

            if (User.IsInRole("students"))
            {
                if (userId == student.Id)
                {
                    return(Ok(studentService.GetStudentById(id)));
                }
                else
                {
                    return(Ok(stsService.GetStudentInfo(studentUsername)));
                }
            }

            return(Ok(studentService.GetStudentById(id)));
        }