[minor] Cleaning up the code, adding gzip and fixed request