Separating out the key/value API code.