Reorganize structure of the code (move api and common into backend) and update all import paths