Add length methods to resources