Code pagination

- added pagination
- extracted services