Add API output buffering