Add middleware prefix if needed