Implemented the RestFul API for the user management and refactored the login/logout logic