added serialisation class and implemented it in controller