add model method for controller, fix #16