small edits to api code