add model relations method, and relations handling