Fixed the issue on the frontend preventing proper spin magnitude choice. Also implemented the error check, i.e. now we know if an error has happened on the backend, translated through to the front end. Also now we pulll in MAT files.