Fixed a stupid error on my part. Code runs and generates JSON.