Handles CSRF token changes

CSRF Tokens change over time. They automatically change after login and logout. So having the csrf token string static works only for one login session. This has been changed, even tough it means for each put/post/delete, the token has to be queried.