fix PHP warnings while running build-api.php

this commit fixes #475
Merge pull request #511 from BradDenver/develop

fix PHP warnings while running build-api.php