Added check for empty response from API when synchronizing