Updated the database and added code in app_code

There still needs to be some testing