JSON to erlang record