added the checkUserKey function and checking the key at each service call