API for javaScript validation