Cache results and handle json decode exception.