Create a serializer class
Raise error if creating with nil value