Added pagination for API