login/logout + db fixes with json