Fix tests & add api.addTradeCommand tests