Refactored REST functions out of server, and updated Makefile accordingly.