Better API requests. More defensive create_buf code

Probably ready to merge.