JS API: fix callbacks and db version