Fix CAS authentication so that it doesn't redirect API calls