upgraded apns protocol to the newest version; added basic error checking for apns