Implemented rules in JSON generator