revise db to use postgres, add static controller files