def GET_name_history(self, path_info, name):
        """
        Get the history of a name or subdomain.
        Requires 'page' in the query string
        return the history on success
        return 400 on invalid start_block or end_block
        return 502 on failure to query blockstack server
        """
        if not check_name(name) and not check_subdomain(name):
            return self._reply_json({'error': 'Invalid name or subdomain'}, status_code=400)

        qs_values = path_info['qs_values']
        page = qs_values.get('page', None)

        if page is None:
            page = "0"        # compatibility 

        try:
            assert len(page) < 10
            page = int(page)
            assert page >= 0
            assert page <= 2**32 - 1
        except:
            log.error("Invalid page")
            self._reply_json({'error': 'Invalid page'}, status_code=400)
            return

        blockstackd_url = get_blockstackd_url()
        res = blockstackd_client.get_name_history_page(name, page, hostport=blockstackd_url)
        if json_is_error(res):
            log.error('Failed to get name history for {}: {}'.format(name, res['error']))
            return self._reply_json({'error': res['error']}, status_code=res.get('http_status', 502))

        return self._reply_json(res['history'])
Get the history of a name or subdomain.
        Requires 'page' in the query string
        return the history on success
        return 400 on invalid start_block or end_block
        return 502 on failure to query blockstack server