text: from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
  from requests import Session
  from typing import Optional
  from json import loads
  
  
  def api_call(session: Session, url: str, parameter: str) -> Optional[list]:
      if parameter is not None:
          url = url.replace("|", parameter)
  
      try:
          response = session.get(url)
          data = loads(response.text)
          return data
      except (ConnectionError, Timeout, TooManyRedirects) as e:
          print(e)
      return None
  