Cleaned up and added documentation
Removed the redundant API factory