Added JAPI Error Handing