Supported the exception handling for REST API.