almost done. TODO: json instances, network clash with its types