fixed api script