All php updated to use new endpoint and global functions. Update includes many fixes and security additions