add serialize interface for extension.