Fixed api.php fatals due to protected field usage