Add a bunch of logging when API actions fail.