fixed some of the bugs in the server backend