[FIX] [TESTS] Simplification of the code and adding unit tests for the server side