add getLastId method and lots of hooks.