apisig function working