                     q      : text
                 headers:
                     'X-HTTP-Method-Override': 'GET'
-            }
+            },
+            (err, res) ->
+                translatedMsg = 'Google translation failed.'
+                if not err
+                    console.log('Google translate API response:')
+                    console.log(JSON.stringify(res, null, 2))
+                    try
+                        translatedMsg = res.data.data
+                                           .translations[0].translatedText
+                    catch exept
+                        console.error(
+                            'Google translation failed with exception:',
+                            except
+                        )
+
+                cb(err, translatedMsg)
         )
+    else
+        console.error('Proper settings for Google API not provided!')
+        cb(null, 'No translation from Google available')
 
-        console.log('Google translate API response:')
-        console.log(JSON.stringify(res, null, 2))
-        res.data.data.translations[0].translatedText
-    else
-        console.error('Proper settings not provided!')
-        'No translate from Google available'
-
-translateUsingBing = (text, source, target) ->
+translateUsingBing = (text, source, target, cb) ->
 
     check(text   , String)
     check(source , String)


    if @BingAccessTokenManager?
        token = BingAccessTokenManager.getToken()
        res = HTTP.call(
            "GET",
            bing_url,
            {

        _id
    )

@createChanslateMsgDoc = (userName, origMsg, origLang) ->
    {
        userName     : userName
