Handle network errors properly

Closes #16
ARGH, these inconsistent data structures are confusing

Closes #15