Fixed makefile and pulled library API to its own file.