Add serializer_cls

Add serializer_cls support into tasks interface.