<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, resource_id, data=None, **params):
 """ Custom handling for updating orderlines. The API returns an Order object. Since we are sending the request through an orderline object, it makes more sense to convert the returned object to to the updated orderline object. If you wish to retrieve the order object, you can do so by using the order_id property of the orderline. """

        path = self.get_resource_name() + '/' + str(resource_id)
        result = self.perform_api_call(self.REST_UPDATE, path, data=data)

        for line in result['lines']:
            if line['id'] == resource_id:
                return self.get_resource_object(line)
        raise DataConsistencyError('Line id {resource_id} not found in response.'.format(resource_id=resource_id))