curl implementation