Add type validation for Get and Put.