updated the APIs with prelogin and postlogin call