Validate ids when deserializing