Add logout functionality, add basic rest support