Add exception handling and base stuff