Cleaning up code + backend fixes