Added middleware function for JSON schema verification