feat: log API errors in non-production environments (#763)