added next/previous page apis
made jquery api emit events