Added JSON generation method