Generic mongoose controller