public async Task <IActionResult> GetTeamAsync(int teamId) { try { var UserIdOfTeam = await teamRepo.GetAssociatedUserIdForTeamAsync(teamId); // Check if the corresponding team is of that user. if (await CheckIfAuthorized(await GetCurrentUser(), UserIdOfTeam) != false) { // return team with ok code. return(Ok(await teamRepo.GetTeamAsync(teamId))); } //not authorized?? or not found?? return(NotFound()); } catch (Exception) { //log?? return(BadRequest()); } }