Remove unneeded files and eliminate some duplicate code.
Fix redirects in backend