Added exists method to check a key exists