Refactor existing object checking APIs into a generic ok_object and add impls for the other object types