handle server connections