Updated client and server side logic.

Updated client and server side logic and completed the back-end module.