updated validator to throw expres-http-errors