Re-added error checking in NXT API