parse JSON responses