Optimize server and add more documentation.