added better errors, thin, postgresql