Fix Push Notification function and add debug api call.