Added some more options to api.connect() to handle automatically setting up an RPC server when a connection isn't made