slightly better api script