bug fixes on login and register api