Fix and add terminate to set Content-Type and Accept header