Fixed invalid javascript in the API examples