Fixed api.php fatals due to protected field usage

bug: 57865
Change-Id: Idafdc353c6b0a2fe6657b3887de4b9d6f1eb1dfd
Merge "Fixed api.php fatals due to protected field usage"