Merging backend

Merging current backend state into backend branch.