Follow manufacturers instructions .
Not that they will not find a way out of the warranty anyway, but some products differ.
The flashing needs to run over the top-most course of roof. Otherwise you are tucking your raincoat into your pants and relying on some sealant to keep it out...hmmm..not good.Seal under the flashing, it will work out fine.
The edges should have a drip edge just like the bottom edge, and seal it down as it suggests. This is usually for that big parachute wind that kicks up and takes the whole roof from the side.
Check out some roofing sites. Try to "google" your roof and get more varying advice,
Good luck, we expect pics of the finished job.
On another note, have you considered a rubber roof? It will last 25 years and it is less work to install.