We are interfacing to an external promotion engine. When we do this, the Magento tax calculation is not correct. The discounts are not being removed before the tax is calculated. What could be wrong? We are using the Magento APi to set the discounts. The tax settings are set to "Total" and "After Discount"