templatized api model and controller