I can make your code work. Anyway, you should think about creating a network layer and dividing the Data, domain and presentation layers a bit;)
You also have some forced unwrapped in the code that could fix you as this is a huge risk for your application. You should never force an optional or a casting.