fixed remaining issues. web api still needs to be implemented.