Added curl error handling and getHTML direct return.