add a to_h method to resources and use that for comparisons