Attached API middleware.