Added missing imports and catched an exception. Also completed missing abstract method implementations.