updated constructor to check for fields starting with "_" or id field is
named as "_id". added test cases