Updating stubs and samples to use apiContext