first shot. Way too much code copied from express