Add regdiff test program and fix the api