fixed id bug and added tests for server