You are not logged in.
You have to use the command_line API.
If you connect to the command_line with a telnet command : telnet %MACHINE_NAME% or %IP_ADDRESS% 8002 [default port]
Your are connected to the Command_Line.
Type help to have API list, then you'll find everything to make your need.
You can read the following wiki page on the COMMAND_LINE topic.