Documented API endpoints, made debug messages more meaningful. Fixed #2