retrieveAccount function now returns the result as raw json document