Logging api exceptions