use `uri.host` instead of hostname to make it work with ruby < 2
in case response is an array, extract the first element
Merge pull request #3 from rngtng/master

Fix array response, fix hostname