diff --git a/docs/build/examples/examples.md b/docs/build/examples/examples.md
index df0c3dae453020da289185e301f80c1b5cc57530..76ed6f138017c04eb31eb9e7cf35cfc31394fc3c 100644
--- a/docs/build/examples/examples.md
+++ b/docs/build/examples/examples.md
@@ -14,13 +14,6 @@ push!(LOAD_PATH, "/home/debian/juliapackages")
 
 When running the examples with hardware in the loop, take caution not to short the BB ground with any output pin, as this will damage the board. For instance, if connecting a diode to the output pins, always use a resistor of >1000 Ohm in parallel. See the configuration page for information on which functionality specific pins support.
 
-- [Examples on the BB](examples.md#Examples-on-the-BB-1)
-    - [Example with LEDs (BB)](examples.md#Example-with-LEDs-(BB)-1)
-    - [Example with GPIOs (BB)](examples.md#Example-with-GPIOs-(BB)-1)
-    - [Example with PWM (BB)](examples.md#Example-with-PWM-(BB)-1)
-    - [Example with SPI (BB)](examples.md#Example-with-SPI-(BB)-1)
-    - [Example with LEDs (HOST)](examples.md#Example-with-LEDs-(HOST)-1)
-
 
 <a id='Example-with-LEDs-(BB)-1'></a>
 
diff --git a/docs/build/figures/beaglebone_black_pinmap.png b/docs/build/fig/beaglebone_black_pinmap.png
similarity index 100%
rename from docs/build/figures/beaglebone_black_pinmap.png
rename to docs/build/fig/beaglebone_black_pinmap.png
diff --git a/docs/build/figures/flashBB.png b/docs/build/fig/flashBB.png
similarity index 100%
rename from docs/build/figures/flashBB.png
rename to docs/build/fig/flashBB.png
diff --git a/docs/build/index.md b/docs/build/index.md
index cf88d123ac535f9bed0348be908c18bd175107ad..0040d56a33b8e43742ef53c5bc5ea96843d23b23 100644
--- a/docs/build/index.md
+++ b/docs/build/index.md
@@ -25,8 +25,12 @@
 
 ## Functions
 
+- [Available devices](lib/io_devices.md#Available-devices-1)
+- [Available functions](lib/functions.md#Available-functions-1)
+
 
 <a id='Documentation-Index-1'></a>
 
 ## Documentation Index
 
+
diff --git a/docs/build/lib/functions.md b/docs/build/lib/functions.md
new file mode 100644
index 0000000000000000000000000000000000000000..ae02010fd1136b4ca12ccaed1d1dccb8636707f1
--- /dev/null
+++ b/docs/build/lib/functions.md
@@ -0,0 +1,12 @@
+
+
+<a id='Available-functions-1'></a>
+
+# Available functions
+
+
+```
+initdev
+closedev
+```
+
diff --git a/docs/build/lib/io_devices.md b/docs/build/lib/io_devices.md
new file mode 100644
index 0000000000000000000000000000000000000000..d79077a826dee0ed8a4b6b434fd950e5763c0ec9
--- /dev/null
+++ b/docs/build/lib/io_devices.md
@@ -0,0 +1,11 @@
+
+
+<a id='Available-devices-1'></a>
+
+# Available devices
+
+
+```
+teardown
+```
+
diff --git a/docs/build/testing.md b/docs/build/testing.md
new file mode 100644
index 0000000000000000000000000000000000000000..d6c3c7465c1d1abf2caf5934ed777f071c0a9993
--- /dev/null
+++ b/docs/build/testing.md
@@ -0,0 +1,27 @@
+
+<a id='Tests-1'></a>
+
+# Tests
+
+
+The BeagleBone tests can be run on any computer, regrdless of their file-syste. By setting the flag RUNNING_TESTS to true, a dummy file-system is exported in which the tests are run operate. This has the advantage of enabling testing of the code run on the BB free from the BB itself, without building the Debian FS, thereby enabling the automatic testing through Travis.
+
+
+To run the tests, simply enter the /test/ directory and run
+
+
+```
+julia run_tests.jl
+```
+
+
+If the tests are to be run on the BB with hardware in the loop, run
+
+
+```
+julia run_tests.jl
+```
+
+
+on the BB, to run examples separately, see
+
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index 3d545898c8a84d8cbd7085a4d7424be657f114c2..1ea408d516136ce2aaa7f22b1128156f9bb2ea07 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -29,3 +29,6 @@ pages:
   - Guide:
     - Introduction: 'man/introduction.md'
     - Installation: 'man/installation.md'
+  - API:
+    - IO devices: 'lib/io_devices.md'
+    - Fucntions: 'lib/functions.md'
diff --git a/docs/src/examples/examples.md b/docs/src/examples/examples.md
index d4cccf5b44d61ea820063f8e9eb80480e05344f8..4bac901e57e4ee2d46602416c9ddc989e2a81b21 100644
--- a/docs/src/examples/examples.md
+++ b/docs/src/examples/examples.md
@@ -1,4 +1,4 @@
-# Examples on the BB
+# Examples
 The following examples may be run from the BB, and may require the user to
 export the the LabConnections module to the LOAD_PATH manually, executing the
 following line in the Julia prompt
@@ -11,11 +11,6 @@ if connecting a diode to the output pins, always use a resistor of >1000 Ohm in
 parallel. See the configuration page for information on which functionality
 specific pins support.
 
-```@contents
-Pages = ["examples.md"]
-Depth = 3
-```
-
 ## Example with LEDs (BB)
 To test the system LED functionality of the Julia code from the BBB, open a
 Julia prompt and run the SYS_LED_test.jl file
diff --git a/docs/src/figures/beaglebone_black_pinmap.png b/docs/src/fig/beaglebone_black_pinmap.png
similarity index 100%
rename from docs/src/figures/beaglebone_black_pinmap.png
rename to docs/src/fig/beaglebone_black_pinmap.png
diff --git a/docs/src/figures/flashBB.png b/docs/src/fig/flashBB.png
similarity index 100%
rename from docs/src/figures/flashBB.png
rename to docs/src/fig/flashBB.png
diff --git a/docs/src/index.md b/docs/src/index.md
index c17b476bbe740335c7ec7044de61bb850dabb1f4..50bfa4c04884c496e6c10305970384c9a8941da1 100644
--- a/docs/src/index.md
+++ b/docs/src/index.md
@@ -11,14 +11,18 @@ Depth = 1
 ```
 
 ## Guide
-
 ```@contents
 Pages = ["man/introduction.md", "man/installation.md"]
 Depth = 1
 ```
 
 ## Functions
-
+```@contents
+Pages = ["lib/io_devices.md", "lib/functions.md"]
+```
 
 ## Documentation Index
-
+```@index
+Pages = ["lib/io_devices.md", "lib/functions.md"]
+Depth = 1
+```
diff --git a/docs/src/lib/functions.md b/docs/src/lib/functions.md
new file mode 100644
index 0000000000000000000000000000000000000000..0995d728fdcbf4f0686a76cb9d8876c031be241d
--- /dev/null
+++ b/docs/src/lib/functions.md
@@ -0,0 +1,9 @@
+```@index
+Pages = ["functions.md"]
+```
+
+# Available functions
+```@docs
+initdev
+closedev
+```
diff --git a/docs/src/lib/io_devices.md b/docs/src/lib/io_devices.md
new file mode 100644
index 0000000000000000000000000000000000000000..4f92ad442fa61074f69763a353c610ecedde3d3b
--- /dev/null
+++ b/docs/src/lib/io_devices.md
@@ -0,0 +1,9 @@
+```@index
+Pages = ["io_devices.md"]
+```
+
+# Available devices
+
+```@docs
+teardown
+```
diff --git a/docs/src/testing.md b/docs/src/testing.md
new file mode 100644
index 0000000000000000000000000000000000000000..98cde17b142f639c26044b01a19970dace0f7165
--- /dev/null
+++ b/docs/src/testing.md
@@ -0,0 +1,16 @@
+# Tests
+The BeagleBone tests can be run on any computer, regrdless of their file-syste.
+By setting the flag RUNNING_TESTS to true, a dummy file-system is exported in
+which the tests are run operate. This has the advantage of enabling testing of
+the code run on the BB free from the BB itself, without building the Debian FS,
+thereby enabling the automatic testing through Travis.
+
+To run the tests, simply enter the /test/ directory and run
+
+    julia run_tests.jl
+
+If the tests are to be run on the BB with hardware in the loop, run
+
+    julia run_tests.jl
+
+on the BB, to run examples separately, see
diff --git a/src/BeagleBone/BeagleBone.jl b/src/BeagleBone/BeagleBone.jl
index 96555d244d4b0efc9f4818ef8ad22c5db292318b..3038aae44afad252697fd26bb585e08a5769c7cf 100644
--- a/src/BeagleBone/BeagleBone.jl
+++ b/src/BeagleBone/BeagleBone.jl
@@ -11,12 +11,10 @@ const DEVICES = Dict("debug" => Debug, "sysled" => SysLED, "gpio" => GPIO, "pwm"
 active_devices = Dict{String,Dict{Int32,IO_Object}}("debug" => Dict{Int32,Debug}(), "sysled" => Dict{Int32,SysLED}(),
                                                           "gpio" => Dict{Int32,GPIO}(), "pwm" => Dict{Int32,PWM}())
 
-"""
-    active_device = initdev(dev_name::String, i:Int32)
+@doc """ active_device = initdev(dev_name::String, i:Int32)
 Initializes a new device of type 'dev_name' at index 'i' on the BeagleBone,
 and adds it to the dict of currently active devices. Returns the initialized
-device 'active_device'.
-"""
+device 'active_device'."""->
 function initdev(dev_name::String, i::Int32)
     #Check if the type of device is valid
     dev_constr = try
@@ -32,11 +30,10 @@ function initdev(dev_name::String, i::Int32)
     return active_device
 end
 
-"""
-    closedev(dev_name::String, i::Int32)
+@doc """ closedev(dev_name::String, i::Int32)
 Closes down a currently active device of type 'dev_name' at index 'i' on the BeagleBone,
 and removes it from the dict of currently active devices.
-"""
+""" ->
 function closedev(dev_name::String, i::Int32)
     active_device = try
         active_devices[dev_name][i]
diff --git a/src/BeagleBone/GPIO.jl b/src/BeagleBone/GPIO.jl
index 6537cf8e99261035344298600090167bc894af6c..1dca4909b3272c920f9ca73c885fa94ed8dd7968 100644
--- a/src/BeagleBone/GPIO.jl
+++ b/src/BeagleBone/GPIO.jl
@@ -16,7 +16,6 @@ The operation of reading the current output value of the GPIO is done by
 
 See the test/BeagleBone/GPIO_test.jl for more examples.
 """
-
 type GPIO <: IO_Object
   i::Int32
   basedir::String
@@ -68,10 +67,9 @@ function read(gpio::GPIO, operation::Int32, debug::Bool=false)
   return l
 end
 
-"""
-  teardown(gpio::GPIO, debug::Bool=false)
+@doc """ teardown(gpio::GPIO, debug::Bool=false)
 Closes all open streams on the GPIO, and unexports it from the file system.
-"""
+""" ->
 function teardown(gpio::GPIO, debug::Bool=false)
   debug && return