change apis for retrieving key/data from cursor, which can be nil