moved database methods to server, updated switch