Update mpns handler to use the new API version.
Also fixes an issue of logging directly to console.