add unit test for sync endpoint