Added most of the implementation for ChunksRepository