def GetErrorsForTemplate(api_query):
  """Prepares and returns the template values for API Query error responses.

  Args:
    api_query: The API Query for which to prepare the errors template values.
  Returns:
    A dict containing a list of template values to use for each API Query
    error responses.
  """
  errors = {}
  if api_query and api_query.api_query_errors:
    error_list = []
    for error in api_query.api_query_errors:
      error_list.append({
          'timestamp': error.timestamp,
          'content': error.content
      })

    errors['errors'] = error_list

  return errors