improved API and IOS prototype