fixed authentication issue for rest calls and sessions