Changed backend to conform with new frontend logic and requirements