fix object ownership
add test method for serialization and deserialization using NSString