add exception for invalid json format

This isn't sufficient. We should consider swapping out a json parser that actually throws errors, then catch them and re-throw our own error.