Semi-proper connections, more API functions

What a mess.