attempt to make phonegap api to work