first implementation of server
Added example, edits to implementation.