Added a little bit of api code