fixed bugs in backend, added register