Added mongo repository, fixed misc bugs. Api ok!