Optimize as_json method - filter requested attributes all at once

- moving adding id into requested attributes to model serialiser;
- support for custom primary_key.