changed around server file to separate serving requests from handling requests, adding a simple application layer