Updated function from RCurl → httr. Addesses issue #5