Sam API error logging improved