Error checking code, working on connection API.