Added idempotency check to agent and server recipe