Implement BASIC middleware functionality.