working phpapi class