<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fetch(self, recursive=1, exclude_children=False, exclude_back_refs=False):
 """Fetch resource from the API server :param recursive: level of recursion for fetching resources :type recursive: int :param exclude_children: don't get children references :type exclude_children: bool :param exclude_back_refs: don't get back_refs references :type exclude_back_refs: bool :rtype: Resource """

        if not self.path.is_resource and not self.path.is_uuid:
            self.check()
        params = {}
        # even if the param is False the API will exclude resources
        if exclude_children:
            params['exclude_children'] = True
        if exclude_back_refs:
            params['exclude_back_refs'] = True
        data = self.session.get_json(self.href, **params)[self.type]
        self.from_dict(data)
        return self