adding a middleware module with functions for head and methodNotAllowed