Fixes #378 by using the GraphDatabaseApI interface and trying to log exceptions in that behaviour