complete login and logout functions
complete register api