Fixes some notices when json response is empty

Fixes some notices when json response is empty