Implemented store capsule handler

Stores the capsule sent by client in the database.