Simple secure rest server in php