Added RequestHandler.
Added logging to sqlite.
Fixed some repetitive function calls.