Update api.pl

Fixed the flags and server output