Switched first method for server to xhr-polling