Proper HTTP status for release

Rearrange code to allow header() to work