Added server

Also refactored stuff