Fixed bug in API Exception handler.