If asset is unspecified or None, returns a dictionary keyed by
        asset ID. The dictionary contains a list of orders for each ID,
        oldest first. If an asset is specified, returns a list of open
        orders for that asset, oldest first. Orders submitted after
        before will not be returned. If provided, only orders of type
        status ('closed' or 'open') will be returned.

def get_all_orders(
            self,
            asset=None,
            before=None,
            status='all',
            days_back=None):
        '''
        If asset is unspecified or None, returns a dictionary keyed by
        asset ID. The dictionary contains a list of orders for each ID,
        oldest first. If an asset is specified, returns a list of open
        orders for that asset, oldest first. Orders submitted after
        before will not be returned. If provided, only orders of type
        status ('closed' or 'open') will be returned.
        '''
        orders = self._backend.all_orders(before, status, days_back)

        omap = {}
        sorted_orders = sorted([
            o for o in orders.values()
        ], key=lambda o: o.dt)
        for order in sorted_orders:
            key = order.asset
            if key not in omap:
                omap[key] = []
            omap[key].append(order.to_api_obj())

        if asset is None:
            return omap

        return omap.get(asset, [])