updates api.class and uses class in example.php