[api] speeding up SQL request handling a bit