Don't think we should throw an exception here..
We could probably just wrap 242-246 inside an ```if($result !== FALSE)``` .. also remove the ```@``` from json_decode