Update applicationApi.js

changed the invokeAPI function