TW: Added error code field to API exception.