more robust error handling in reporting API