Rewrite resource validator and add some tests

New resource validator doesn't suffer the problem of returning error for
has_many association object fields