implement the Diff API

test added as well.
reorganise the test.