Implemented most of the changes required by API code review

Change-Id: I024d25d48c3bf1360d28f8b931c4687fed5f6553