added pagination support in controller