Added middleware to validate that the current HTTP method is allowed for the requested resource.