format headers, hook in loopback