Updated to work with new header-based authentication