Added API wrapper.
Make gzip decompression a seperate function.