Code refactoring and add server actions panels to demo2