Add AdapterError class and clean up application controller.