Fix more regressions from request-local session
More work on API: now proper sorted tables