Server-side refactoring

Also, I do not understand why do you pass array of items to buy from client to server side during "Add new item to buy", "Edit new item to buy" and "Purchase" operations. IMO you should pass a single object in these cases