Added stack trace to error message
fixed wrong URL and logs errors
changed over to prepared statements in many places

- SQL at DB.java line 162 uses single quotes which is a problem when any
words contain a work like "aren't" plus it doesn't use prepared
statements so it's highly suseptible to SQL injection.
small changes
Change to root directory for pusblishing