middleware for copter