Corrected Server createJson() for proper keypair handling