added return rc; changed the way the API process KV pairs for leaveSystem