Updated ApiCaller to allow better diagnosis of errors