Moved api code into separate project