Properly close curl connection
Ditch url_encode in favor of http_build_query
Consistent concatenation
Merge pull request #2 from ebildude123/master

Fixes/efficiency