Added PHP session checking to each PHP API file