Convert Java Objects to JSON format