separating api from leveldb implementation