Add request and response trace methods to APIError

Change-Id: Ic4d305be8ce38e42446e6859664d62f40ef70848