Updated the server to handle post methods with certain urls (as per the assignment). I also updated efficieny of the code and it is working.