Implemented most of javascript sync client