need to output http status here, as no access to responseWriter from user-defined function