Added withCredentials parameter and passing it to xhr requests