Remove unused permissions and clean up api logging