Update api.php

Notices fix