Decouple the json timeout from the actual error code.

Fixes #50
Merge pull request #51 from mzanetti/fix-timeout

Decouple the json timeout from the actual error code.