Initial implementation of server code, and some new constants