* use exit rather than drupal_exit
* use correct json_encode param