bugfix to api command, lines in wrong order