Api/changes

@oalders : I have made all the changes to the scripts in this pull requests. And tidied everything.

Please have a look at it.