fixed bugs with handling CORS redirects & CKAN errors

Change-Id: I7fa85a73f12814e33adb1712a7936f73ba437f69