[api] move some model code out of request controller