clear before fix login and more api functions