Initial commit for backend functionality.

Sorry for not submitting this request until now.