Ensure json responses

Fixes #10