Rework logic to accommodate server with secret key