honour path parameter of storage directive and handle errors

This is a continuation of #252 

cc @aspiers