Set response codes and headers.