Update server code to use catalog

This should be good to merge.