Clean up server interface and return useful errors.
Fixup some formatting
Merge pull request #1 from edahlgren/master

Return useful error messages and debug information.