fixed undefined index errors on GET requests

This pull request fixes CURLOPT_URL index error and http_build_query formatting on GET the requests.