Revert Revert + Standardising the api errors

Bug: 45276 50588
Change-Id: I6778059a0fae987db25712fc043ce4e0bef37d74