Added support for automatic JSON response parsing.

Fixes #3