public JsonResult NonIssueMembers(string term, int issueId)
        {
            //Returns team members who are not assigned to the issue in a list in JSON format
            try
            {
                //TO DO : Have repo method to directly get non issue members

                var team = repo.GetTeam(TeamID);
                var list = new List<MemberVM>();
                var existingIssueMembers = repo.GetIssueMembers(issueId).ToList();

                var projectMembers = team.TeamMembers.Where(s => s.Member.FirstName.StartsWith(term, StringComparison.OrdinalIgnoreCase)).ToList();
                foreach (var member in projectMembers)
                {
                    if (!existingIssueMembers.Any(s => s.MemberID == member.MemberID))
                    {
                        var memberVM = new MemberVM { AvatarHash = UserService.GetAvatarUrl(member.Member.Avatar) };
                        memberVM.Name = member.Member.FirstName;
                        memberVM.MemberID = member.Member.ID;
                        list.Add(memberVM);
                    }
                }
                return Json(list, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                log.Error(ex);
                return Json(new { Status = "Error", Message = "Troubles getting team members", JsonRequestBehavior.AllowGet });
            }
        }
        public ActionResult Index()
        {
            try
            {
                var team = repo.GetTeam(TeamID);
                var teamVM = new TeamVM { Name = team.Name, Id = team.ID };

                var teamMembers = team.TeamMembers.OrderBy(s=>s.Member.FirstName).ToList();
                foreach (var member in teamMembers)
                {
                    var memberVM = new MemberVM();
                    memberVM.Name = member.Member.FirstName;
                    memberVM.EmailAddress = member.Member.EmailAddress;
                    memberVM.AvatarHash = UserService.GetAvatarUrl(member.Member.Avatar, 30);
                    memberVM.JoinedDate = member.CreatedDate.ToShortDateString();
                    if(member.Member.LastLoginDate.HasValue)
                        memberVM.LastLoginDate=member.Member.LastLoginDate.Value.ToString("g");

                    teamVM.Members.Add(memberVM);
                }

                var membersNotJoinedList = repo.GetTeamMembersWhoHasntJoined(TeamID).OrderBy(s=>s.EmailAddress).ToList();
                foreach (var member in membersNotJoinedList)
                {
                    var invitation = new MemberInvitation { EmailAddress = member.EmailAddress, DateInvited = member.CreatedDate.ToString("g") };
                    invitation.AvatarHash = UserService.GetImageSource(member.EmailAddress);
                    teamVM.MembersInvited.Add(invitation);
                }  
                return View(teamVM);
            }
            catch (Exception ex)
            {
                log.Error(ex);
                return View("Error");
            }
        }