Actually properly close database session on /n/ API query.