Adding http headers and http response code