implement diff resource api.