implemeted function to setup res headers