Fixed error reporting for when API gives a non-200 status code.