Refactoring the formatResponse function
Adding in gzip compression for responses