Updated back-end side  to remove all unneccessary spaces including spaces that occur more than once in between strings