Added some options for curl and fixed the json parsing