JSON.parse errors are now caught in ApiCall

If a server returns 200 but no proper JSON, this is now caught in apiCall, which now does the JSON.parse that before was used all over the file.