improved login, added logout
added cache, refactoring