Update API and gen-stubs.php