Clean out the API and introduce writeFetchHeadItems and getFetchHeadItems.