move API documentation from github wiki

This still looks rather ugly, but it's a start.