Add serialisation to persist network