laid groundwork for function import handshake
error handling still a little shaky