def _create_rest_url(host, version, resource, query_id):
    """Creates the URL for querying the REST service"""
    pokeapi_rest = 'api'
    url_parts = [host, pokeapi_rest, version]
    if resource is not None:
        url_parts.append(resource)
    if query_id is not None:
        url_parts.append(query_id)
    url = 'http://' + '/'.join(url_parts)
    return url
