Update api.php

Update constructor method call