A quick fix to MainForm being null at the Api class.