change functions validate() to validateAll() and saveIt() to extract().
add count field in json index() return