using hash and create_resources function to itareate over hash