fix APIError reference