added pagination and model validation
merged with master