Added custom exceptions and pid based file locking to preserve issues of modifying json files while in use by server.