Log exception traces in APIs

Fixes bug: #1229292

Change-Id: I3b87c63cf1dc0100e34418b588d215a6e61e2ad1
Merge "Log exception traces in APIs"