fixed cli sort and tests
fixed json and sort tests
fixed repository test