layout and login api fixes