Update index.php
Update index.php

A COLD restart of Pi would give incorrect result without the init(), to replicate the issue power off Pi and power it up again. Then immediately go to the REST API and try to GET and SET some values, it will fail.  The interesting part is that.. only one time init() is necessary for the whole system after cold boot. In other words, you can run another PHP file with Init(),  a Python script that triggers PiFace, or even simply launch PiFace Digital Emulator after cold boot. After that, it would give you the correct value until next cold boot.  I am not expert enough to say what happened but it seems like it triggers something at the background. But this simple line fixed the problem.
natefanaro/piface-rest-api