Added new structure and fixed some bugs in he login and register controller