async def get_handler_league_by_id(request, league_id):
    """
    Get a League
    :param
        name : String - the league name
        season : Number - the season year
    :return
    request example
        {
            "name": Spanish
            "season": 2020,
            "teams": ["real madrid", "hapoel jerusalem"],
            "matches": [match_id_#1, match_id_#2, match_id_#3]
        }
    """
    logger.info(f'Server/Get League by id - start | id: {league_id}')
    try:
        parsed_request = {"_id": ObjectId(league_id)}

        logger.debug(
            f'Server/Get League by id - calling MongoDbService/find_league | request: {parsed_request}'
        )
        _league = db.find_league(parsed_request)
        logger.debug(
            f'Server/Get League by id - MongoDbService/find_league succeeded | league: {_league}'
        )

        logger.debug(
            f'Server/Get League by id - calling leagueProvider/parse_league_from_db | league: {_league}'
        )
        parsed_league = parse_league_from_db(_league)
        logger.debug(
            f'Server/Get League by id - leagueProvider/parse_league_from_db succeeded | parsed league: {parsed_league}'
        )

    except Exception as error:
        logger.error(f'Server/Get League by id failed - error: {error}')
        return rjson({'status': 'Error', 'message': str(error)}, status=400)

    else:
        logger.info(
            f'Server/Get League by id succeeded - league: {parsed_league}')
        return rjson(
            {
                'status': "success",
                'message': 'success',
                'league': str(parsed_league)
            },
            status=200)

    finally:
        logger.info(f'Server/Get League by id - end')
async def get_handler_league_by_name_season(request, name, season):
    """
    Get a League by name & season
    :param
        name : String - the league name
        season : Number - the season year
    :return
    response example
        {
            "name": Spanish
            "season": 2020,
            "teams": ["real madrid", "hapoel jerusalem"],
            "matches": [match_id_#1, match_id_#2, match_id_#3]
        }
    """
    logger.info(
        f'Server/Get League by name & season - start | name: {name}, season: {season}'
    )
    try:
        parsed_request = {"name": name, "season": season}
        logger.debug(
            f'Server/Get League by name & season - calling validate_schema | request: {parsed_request}, schema: {LeagueSchema}'
        )
        validate_schema(instance=parsed_request, schema=LeagueSchema)
        logger.debug(
            'Server/Get League by name & season - input validation succeeded')

        logger.debug(
            f'Server/Get League by name & season - calling MongoDbService/find_league | request: {parsed_request}'
        )
        _league = db.find_league(parsed_request)
        logger.debug(
            f'Server/Get League by name & season - MongoDbService/find_league succeeded | league: {_league}'
        )

        logger.debug(
            f'Server/Get League by name & season - calling leagueProvider/parse_league_from_db | league: {_league}'
        )
        parsed_league = parse_league_from_db(_league)
        logger.debug(
            f'Server/Get League by name & season - leagueProvider/parse_league_from_db succeeded | parsed league: {parsed_league}'
        )

    except ValidationError as error:
        logger.error(
            f'Server/Get League by name & season failed - validation error | error: {error}'
        )
        return rjson({
            'status': 'Error',
            'message': str(error.message)
        },
                     status=400)

    except Exception as error:
        logger.error(
            f'Server/Get League by name & season failed - error: {error}')
        return rjson({'status': 'Error', 'message': str(error)}, status=400)

    else:
        logger.info(
            f'Server/Get League by name & season succeeded - id: {parsed_league}'
        )
        return rjson(
            {
                'status': "success",
                'message': 'success',
                'league': str(parsed_league)
            },
            status=200)

    finally:
        logger.info(f'Server/Get League by name & season - end')
async def get_handler_team_that_wins_the_least(request, name, season):
    """
    Get the team least wins in league
    :param
        name : String - the league name
        season : Number - the season year
    :return

    """
    logger.info(
        f'Server/Get Team that win the least in league - start | name: {name}, season: {season}'
    )
    try:
        parsed_request = {"name": name, "season": season}
        logger.debug(
            f'Server/Get Team that win the least in league - calling validate_schema | request: {parsed_request}, schema: {LeagueSchema}'
        )
        validate_schema(instance=parsed_request, schema=LeagueSchema)
        logger.debug(
            'Server/Get Team that score the least in league - input validation succeeded'
        )

        logger.debug(
            f'Server/Get Team that win the least in league - calling MongoDbService/find_league | request: {parsed_request}'
        )
        _league = db.find_league(parsed_request)
        logger.debug(
            f'Server/Get Team that win the least in league - MongoDbService/find_league succeeded | league: {_league}'
        )

        logger.debug(
            f'Server/Get Team that win the least in league - calling leagueProvider/parse_league_from_db | league: {_league}'
        )
        parsed_league = parse_league_from_db(_league)
        logger.debug(
            f'Server/Get Team that win the least in league - leagueProvider/parse_league_from_db succeeded | parsed league: {parsed_league}'
        )

        logger.debug(
            f'Server/Get Team that win the least in league - calling MongoDbService/find_teams_from_league | league: {parsed_league}'
        )
        teams = db.find_teams_from_league(parsed_league)
        logger.debug(
            f'Server/Get Team that win the least in league - MongoDbService/find_teams_from_league succeeded | parsed league: {parsed_league}'
        )

        logger.debug(
            f'Server/Get Team that win the least in league - calling teamProvider/find_team_least_wins | teams: {teams}'
        )
        team_win_least = find_team_least_wins(teams)
        logger.debug(
            f'Server/Get Team that win the least in league - teamProvider/find_team_least_wins succeeded | team win most: {team_win_least}'
        )

    except ValidationError as error:
        logger.error(
            f'Server/Get Team that win the least in league failed - validation error | error: {error}'
        )
        return rjson({
            'status': 'Error',
            'message': str(error.message)
        },
                     status=400)

    except Exception as error:
        logger.error(
            f'Server/Get Team that win the least in league failed - error: {error}'
        )
        return rjson({'status': 'Error', 'message': str(error)}, status=400)

    else:
        logger.info(
            f'Server/Get Team that win the least in league succeeded - id: {parsed_league}'
        )
        return rjson(
            {
                'status': "success",
                'message':
                f'The team that win the least in {parsed_request["name"]}, Amount of wins: {team_win_least["number_of_wins"]}',
                'team name': str(team_win_least['name'])
            },
            status=200)

    finally:
        logger.info(f'Server/Get Team that win the least in league - end')