Catch API exceptions (Bug #13054).
Fix bug number.