correct http headers and json stringify