Let $C$ be a nonsingular projective curve of genus $g \geq 0$ over a finite field $\mathbb{F}_q$ with $q$ elements. From this curve, we define the zeta function $$Z_{C/{\mathbb{F}}_q}(u) = \exp\left(\sum^{\infty}_{n = 1}{\frac{\# C(\mathbb{F}_{q^n})}{n} u^n}\right),$$ valid for all $|u| < q^{-1}$. This zeta function extends meromophicially to $\mathbb{C}$ via the equation $$Z_{C / \mathbb{F}_q}(u) = \frac{P_{C / \mathbb{F}_q}(u)}{(1 - u) (1 - qu)}$$ for some polynomial with coefficients in $\mathbb{Z}$ that factorises as $$P_{C/\mathbb{F}_q}(u) = \prod^{2g}_{j = 1}{(1 - \gamma_j u)}$$ with $|\gamma_j| = \sqrt{q}$ and $\gamma_{j + g} = \overline{\gamma_j}$ for all $1 \leq j \leq g$. This last point tells us that $Z_{C / \mathbb{F}_q}(u)$ has a functional equation and satisfies a version of the Riemann hypothesis.
What happens if we run this construction in reverse? What if we start with a set of numbers $\gamma_j$, $1 \leq j \leq 2g$, such that $|\gamma_j| = \sqrt{q}$, $\gamma_{j + g} = \overline{\gamma_j}$ for all $1 \leq j \leq g$, and such that the polynomial $$P(u) = \prod^{2g}_{j = 1}{(1 - \gamma_j u)}$$ has coefficients in $\mathbb{Z}$? Is there a way of telling whether the function $$\frac{P(u)}{(1 - u) (1 - qu)}$$ is the zeta function of some curve $C$? Furthermore, what is this curve exactly?
A simple case of this is if we look at the function $$\frac{1 - au + qu^2}{(1 - u) (1 - qu)}$$ for some $a \in \mathbb{Z}$ with $|a| \leq 2 \sqrt{q}$. How do we determine whether this function is the zeta function $Z_{C / \mathbb{F}_q}(u)$ of an elliptic curve $C$ over $\mathbb{F}_q$? If it is indeed equal to $Z_{C / \mathbb{F}_q}(u)$, what is the Weierstrass equation for $C$ (assuming $\mathrm{char}(q) \geq 5$)?