added pagination and fixed issue with has and belongs to many
merge