added testing code for json