option to split validation middleware from error handling middleware