removes unnecessary json_encode() and print_r()