added better debugging for when rest requests fail