Density of rational points over finite fields, an estimate of Lang-Weil constant Let $X\hookrightarrow\mathbb P^n_{\mathbb F_q}$ be a geometrically integral hypersurface over the finite field $\mathbb F_q$ of degree $\delta$. In order to estimate the number of its rational points, we have
$$|\#X(\mathbb F_q)-(q^{n-1}+\cdots+1)|\leq(\delta-1)(\delta-2)q^{n-\frac{3}{2}}+C(n,\delta)q^{n-2}.$$
My question is about the order of $\delta$ in the constant $C(n,\delta)$. In fact, we have $C(n,\delta)\ll_n\delta^4$ uniformly, and when $q$ is large enough, we can prove $C(n,\delta)\ll_n\delta^2$. Can we prove $C(n,\delta)\ll_n\delta^2$ uniformly for all $q$?
If it is too difficult, we can consider whether we can prove 
$$|\#X(\mathbb F_q)-(q^{n-1}+\cdots+1)|\leq C'(n,\delta)q^{n-\frac{3}{2}},$$
where we require $C'(n,\delta)\ll_n\delta^2$ uniformly. Of course, this is OK for the case of $n=2$, but for arbitrary dimension, I don't know......
PS. When $q\ll\delta^2$ or $\delta^4\ll q$, we can prove it. But when $\delta^2 \ll q\ll \delta^4$, I don't know......
 A: When $q$ is large, one can in fact take $C(n,\delta)=\delta+10$; see Corollary 6 and Corollary 9 in my paper ``An application of random plane slicing to counting $\mathbb{F}_q$-points on hypersurfaces,'' https://arxiv.org/pdf/1703.05062.pdf. Explicitly, this bound holds for $q\geq 4\delta^{13/3}$. If you can prove that one can take $C(n,\delta)=O(\delta^4)$ uniformly in $q$, then the proof of Corollary 6 in the above paper will give $C(n,d)=O(d)$ for $q\geq d^4$. 
You can also look at the paper by A. Cafure, G. Matera, Improved explicit estimates on the number of solutions of equations over a finite field, Finite Fields and Their Applications 12 (2006) 155–185, https://arxiv.org/abs/math/0405302. They prove, among other things, that one can take $C(n,\delta)=5\delta^{13/3}$ uniformly. They also review the literature on the problem. 
In the regime when $q$ is small, one can use alternative bounds for $\#X(\mathbb{F}_q)$; for example, $\#X(\mathbb{F}_q)\leq \delta q^{n-1}$ is an easy bound (see, for example, Lemma 2.1 in the paper of Cafure and Matera); then, as far as the upper bound for $\#X(\mathbb{F}_q)$ is concerned, one can take $C'(n,\delta)=O(\delta^2)$ as long as $q=O(\delta^2)$. But then one would need to handle the range for $q$ between $d^2$ and $d^4$. I would guess that there are some further bounds for $\#X(\mathbb{F}_q)$ that would turn handy in this range.
