Make model objects serializable