PHP API to handle serverside