More udp api polish, and added test case