Rework the slice API

more unit-test are passing.