updated existing  API calls to take advantage of PHP variable functions