Fix json parsing

Fix json parsing. HTTP responses with empty bodies were causing JSON parsing error. Now we only parse the body if there is one. Also clean up simplejson vs. json.