New saveResource return function

Little extend for saveResource, javadoc also added.