switching between table view and json view works