Added detailed API documentation

Added detailed API documentation to stop confusion.