got the basics of the api working, also had to rewrite the picture and captions classes