<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def backfill(self, data, resolution, start, end=None):
 """ Backfills missing historical data :Optional: data : pd.DataFrame Minimum required bars for backfill attempt resolution : str Algo resolution start: datetime Backfill start date (YYYY-MM-DD [HH:MM:SS[.MS]). end: datetime Backfill end date (YYYY-MM-DD [HH:MM:SS[.MS]). Default is None :Returns: status : mixed False for "won't backfill" / True for "backfilling, please wait" """


        data.sort_index(inplace=True)

        # currenly only supporting minute-data
        if resolution[-1] in ("K", "V"):
            self.backfilled = True
            return None

        # missing history?
        start_date = parse_date(start)
        end_date = parse_date(end) if end else datetime.utcnow()

        if data.empty:
            first_date = datetime.utcnow()
            last_date = datetime.utcnow()
        else:
            first_date = tools.datetime64_to_datetime(data.index.values[0])
            last_date = tools.datetime64_to_datetime(data.index.values[-1])

        ib_lookback = None
        if start_date < first_date:
            ib_lookback = tools.ib_duration_str(start_date)
        elif end_date > last_date:
            ib_lookback = tools.ib_duration_str(last_date)

        if not ib_lookback:
            self.backfilled = True
            return None

        self.backfill_resolution = "1 min" if resolution[-1] not in (
            "K", "V", "S") else "1 sec"
        self.log_blotter.warning("Backfilling historical data from IB...")

        # request parameters
        params = {
            "lookback": ib_lookback,
            "resolution": self.backfill_resolution,
            "data": "TRADES",
            "rth": False,
            "end_datetime": None,
            "csv_path": None
        }

        # if connection is active - request data
        self.ibConn.requestHistoricalData(**params)

        # wait for backfill to complete
        while not self.backfilled:
            time.sleep(0.01)

        # otherwise, pass the parameters to the caller
        return True