Sorry I should have clarified at the start, this is for a local Intranet that has no connection to the Arcgis.com Javascript API.Solved it by downloading and configuring the JSAPI 3.1 and configuring the config-rest.properties file in the installation directory. After that i had to delete the browsing history and cookies and then all working.