Completed the server side logic ( need syncing with client logic)