added pagination and query capabilities for contacts