Added pagination to the REST API