Add API setter and relevant tests