For some reason when I export I get about 2 minutes of extra black screen at the end of my movie. I tried adding
out markers but I haven't been able to fix the problem.
There are three things you have to get right:
You have to have the right length of video in your sequence (which can be helped by having explicitly set in and out markers at the right place).
You have to export the correct sequence. If you don't have the correct sequence selected when you render, your export might, by coincidence, render the same content you are looking at, but from from a differently defined perspective--one that has a different concept of the in and out points you have defined for the sequence you should be rendering.
In the rendering window, there are several options, including whether to render the whole clip (irrespective of in and out points), render just between in and out, or some other options.
Try setting the correct in and out points, rendering the correct sequence, and then ensuring that your rendering actually honors the sequence's in and out points.
If you're having trouble getting FCPX to export exactly what you want, look no further than the range select tool.
Use the "r" keyboard shortcut to summon the tool, drag a marquee around everything you want to include in the export (or cmd-a for your whole timeline), then cmd-e to export (or your favorite flavor from the share menu). In the export dialog, you can skim through the video to make sure everything you want is included and everything you don't is excluded.