add method to validate keys; return -1 if a method was used with an invalid key.