Updates to rest api: replace primary