add timeout to curl, enable debug mode.