Building api

Adds basic but broken api and mongodb integration.