Refactor views and add stub code to support API server.