Hi Ladan,
Without seeing the server error logged in your Apache error.log file, I can't be certain what the error is. Usually when you get a server error, a function is undefined causing the script to halt and issue the error.
Line 344 is a call to add_query_var that is defined in the WP class. This suggests that your theme or a different plugin is killing the $GLOBAL['wp'] object.
Perhaps you can disable your plugins first -- one by one -- to see which one is the culprit. If still have a problem, change your theme to one of the stock themes.
This may be related:
http://www.wpbeginner.com/wp-tutorials/how-to-fix-yoasts-wordpress-seo-sitemap-404-error/