assign attributes and serialization from/to json