fixed deserializing network connections
+ added tests for converting from JSON