Updated response handling
Added sync() function