Use given connection for testing
Fix wrong method name:
sendMessage =>
emitMessage
Don't register not implemented APIs for the application
Simplify createHandler() for API registeration