Tests for netapi

Complete set of tests for the netapi methods, excluding locking for now.