updated to synchronous http request for cordova