<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def element_name_and_type_by_href(href):
 """ Retrieve the element name and type of element based on the href. You may have a href that is within another element reference and want more information on that reference. :param str href: href of element :return: tuple (name, type) """

    if href:
        element = fetch_json_by_href(href)
        if element.json:
            for entries in element.json.get('link'):
                if entries.get('rel') == 'self':
                    typeof = entries.get('type')

            return (element.json.get('name'),
                    typeof)