Fix  undefined method name for Api when using Model.require_permission