Add support for limit and offset to js