refactored whole app, wrote custom getAPID class to pass APID from Android to Javascript