added login and register ajax calls