Better thread sync, new defaut API key.

Signed-off-by: NeatMonster <neatmonster@hotmail.fr>
Added cache to offline sessions.