fix models and ensure docs is always returned as an array