make Resource flow work for metaresource and improve imports handling