Write a ‘not_found’ helper 

sub not_found {
    my $message = shift || "404 Not Found";
    status "not_found";
    return template "404", { message => $message };
}