Hooked up application code to serial code

Wrote exceptions and error handling.