try harder to always return json for errors. fixes #21