Do not unpack the JSON object like this. You cannot assume JSON objects will be {[{key, value},...]}. Treat them as opaque objects, and you don't know how they are represented. That is what wh_json.erl is for!