added support for logout, better support for JWT tokens