ajax implementation for registration